﻿using Microsoft.EntityFrameworkCore.Metadata.Internal;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Entity
{
    public class Base
    {
        public Base()
        {
            this.ID = Guid.NewGuid();
            this.IsLock = false;
            this.IsDelete = false;
            this.CreatTime = DateTime.Now;
        }
        /// <summary>
        /// 自增id
        /// </summary>
        ///[Key]
        ///[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        ///public int id { get; set; }
        
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        [Column("P01")]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Guid ID { get; set; }


        public string LastName { get; set; }
        public string FirstName { get; set; }

        /// <summary>
        /// 是否被锁定
        /// </summary>
        [Column("P02")]
        public Boolean IsLock { get; set; }
        /// <summary>
        /// 是否删除
        /// </summary>
        [Column("P03")]
        public bool IsDelete { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("P04")]
        [Required]
        public DateTime CreatTime { get; set; }
    }
}
